# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=golang-github-davecgh-go-spew
pkgver=1.1.1
pkgrel=2
pkgdesc='Implements a deep pretty printer for Go data structures to aid in debugging'
arch=('any')
url="https://github.com/davecgh/go-spew"
license=('ISC')
depends=('go')
source=("$pkgname-$pkgver.tar.gz::https://github.com/davecgh/go-spew/archive/v$pkgver.tar.gz")
sha512sums=('b00621d2f11c4cc858e69fda3e6975f910deb375c4f2305a45b230e2d9be73f183db5d2ce4f5e30a14b27e11e79380233ee68fceeef0d855c64fca966e68111e')

check() {
  export GOPATH="$srcdir/build:/usr/share/gocode"
  mkdir -p "$srcdir"/build/src/github.com/davecgh
  cp -a "$srcdir"/go-spew-$pkgver "$srcdir"/build/src/github.com/davecgh/go-spew
  cd "$srcdir"/build/src/github.com/davecgh/go-spew
  go test -v $(go list ./...)
}

package() {
  mkdir -p "$pkgdir"/usr/share/gocode/src/github.com/davecgh
  cp -a "$srcdir"/go-spew-$pkgver "$pkgdir"/usr/share/gocode/src/github.com/davecgh/go-spew

  install -Dm644 go-spew-$pkgver/LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
